package com.hzj.service;

import com.hzj.pojo.*;
import com.hzj.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@Service
@FeignClient(name = "PROVIDER-HOSP-8002", contextId = "HospitalService")
public interface HospitalService {

    @PostMapping("/api/hosp/hospital/{page}/{limit}")
    Result getPageList(@PathVariable Integer page, @PathVariable Integer limit, @RequestParam(required = false) String hostype, @RequestParam(required = false) String districtCode);

    @PostMapping("/api/hosp/hospital/findByHosname/{hosname}")
    Result findByHosname(@PathVariable String hosname);

    @PostMapping("/api/hosp/hospital/{hoscode}")
    HospitalInfo hospitalByHoscode(@PathVariable String hoscode);

    @PostMapping("/api/hosp/hospital/department/{hoscode}")
    List<Map<String, Object>> findDepartment(@PathVariable String hoscode);

    @PostMapping("/api/hosp/hospital/auth/findScheduleList/{hoscode}/{depcode}/{workDate}")
    Result findScheduleList(@PathVariable String hoscode, @PathVariable Integer depcode, @PathVariable String workDate);

    @PostMapping("/api/hosp/hospital/auth/getBookingScheduleRule/{page}/{limit}/{hoscode}/{depcode}")
    Result getBookingScheduleRule(@PathVariable Integer page, @PathVariable Integer limit, @PathVariable String hoscode, @PathVariable Integer depcode);

    @PostMapping("/api/hosp/hospital/auth/getSchedule/{id}")
    Schedule getSchedule(@PathVariable Integer id);

    @PostMapping("/api/hosp/hospital/auth/getDepartmentByCode/{depcode}")
    Department getDepartmentByCode(@PathVariable String depcode);

    @PostMapping("/api/hosp/hospital/auth/getHospitalSetByHoscode/{hoscode}")
    HospitalSet getHospitalSetByHoscode(@PathVariable String hoscode);

    @PostMapping("/api/hosp/hospital/auth/updateScheduleById")
    Boolean updateScheduleById(@RequestBody Schedule schedule);

    @PostMapping("/api/hosp/hospital/auth/getScheduleByAddHosScheduleId/{hosScheduleId}")
    boolean getScheduleByAddHosScheduleId(@PathVariable String hosScheduleId);
}
